1. Field of the Invention
The present invention relates to a method of quantizing predictive errors, and more particularly to a method of quantizing predictive errors which are obtained, for example, when compressing image data having gradations with predictive coding.
2. Description of the Prior Art
Digital image data (digital image signals) stored in a recording medium such as an optical disk is read out so as to be reproduced as a visible image on a CRT or the like, or transmitted over facsimile or the like to a receiver where a visible image may be reproduced from the received image data.
When storing or transmitting the digital image data, it is preferable to reduce the amount of image data because the amount of digital-.image data with gradations is extremely large and it would be highly costly in storing or transmitting such digital image data as it is.
One known method of reducing the amount of image data (i.e., the amount of digital image signals) is predictive coding. The predictive coding is based on the principle that an image data item of interest can be thought of as having a data value similar to that of a nearby image data item. The image data item of interest is predicted in a suitable manner from the nearby image data item, and the difference between the predicted data value and the actual data value, i.e., a predictive error, is determined. Based on the phenomenon that a distribution of such predictive errors is clustered around zero, the predictive errors are coded by variable word length coding (a signal with its word length variable dependent on the value to be coded) such as Huffman coding in which a short code is assigned to predictive errors that are more frequent and a long code is assigned to those which are less frequent. By thus coding the predictive errors, the redundancy of the image data is suppressed thereby to compress the amount of data as a whole.
In the predictive coding process, it is preferable, if allowable in view of the available image quality margin, to code a predictive error after it has been quantized into a rougher range of quantities, rather than to code the predictive error as it is, because the amount of image data can be reduced as much as the predictive error has been quantized into rougher quantities, so that the data compression ratio can be increased. Quantization used herein means that x (original data) having a value in the range of x.sub.i .ltoreq.x.ltoreq.x.sub.i+1 is represented by Xi (representative quantized value), or stated otherwise, original data x in a certain quantizing range (x.sub.i to x.sub.i+1) is replaced with one representative quantized value Xi.
According to conventional quantization, it is general to employ, as a representative quantized value Xi, a median value, expressed below, of original data items x.sub.i to x.sub.i+1 : ##EQU1## as shown in FIG. 3(a), or a suitable value close to the median value (an integral value close to the median value), as shown in FIG. 3(b). However, such conventional quantization may not be used as quantization for predictive errors for the reasons given below.
As described above, predictive errors are not uniformly distributed but clustered around zero, and hence the sum (hereinafter referred to as a "quantization error") of the differences between the median value and the respective original data items (predictive error data items) in the quantizing range becomes greater. Therefore, the median value is no longer used as a value representative of each original data item in the quantizing range, with the result that the image quality will be more degraded by quantization than possible with an optimum representative quantized value.